package easy.id_701_800;

import java.util.LinkedHashSet;
import java.util.Set;

public class Lee771 {
    public static void main(String[] args) {
        String jewels = "aA", stones = "aAAbbbb";
        String jewels2 = "z", stones2 = "ZZ";
        System.out.println(numJewelsInStones(jewels2, stones2));

    }
    public static int numJewelsInStones(String jewels, String stones) {
        Set<Character> set=new LinkedHashSet<>();
        for(int i=0;i<jewels.length();i++){
            set.add(jewels.charAt(i));
        }
        int result=0;
        for(int i=0;i<stones.length();i++){
            if(set.contains(stones.charAt(i))){
                result++;
            }
        }
        return result;
    }


}
